package com.kgcx.opc.common.utils.bean;

import com.alibaba.fastjson.JSONObject;
import com.kgcx.common.client.opc.pojo.*;
import com.kgcx.common.client.order.pojo.Order;
import com.kgcx.common.client.order.pojo.Order4Flat;
import com.kgcx.common.client.order.pojo.PayAccount;
import com.kgcx.common.rabbitmq.bean.Message;
import com.kgcx.common.utils.DateTimeUtils;
import com.kgcx.opc.common.utils.String.StringUtil;
import com.kgcx.opc.common.utils.date.DateUtils;
import com.kgcx.opc.common.utils.String.CityUtils;
import com.kgcx.opc.service.impl.SendImgService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 何凯
 * @version 0.1
 * @description
 * @time 2017/11/15 18:27
 * @since 0.1
 */
@Slf4j
@Component
public class BeanUtil {



    public static final String companyId ="kgzc";
    public static final String companyName ="空港专车";
    public static final Integer encrypt= 1;
    public static  final Integer elevation=23;//海拔
    public  static final Integer bizStatus=1;
    public  static final Integer UpPriceStartMile=15;//单程加价公里

    /**
     * 网约车平台公司基本信息 25 11.20
     * @param message
     * @return
     */
    public Map<String,Object> setBeanByCompany(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       BaseInfo company= JSONObject.parseObject(message.getBody().toString(),BaseInfo.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("CompanyName",company.getCompanyName()==null?"":company.getCompanyName());//公司名称
       resultMap.put("Identifier",company.getIdentifier()==null?"":company.getIdentifier());//统一社会信用代码
       resultMap.put("Address" ,company.getAddress()==null?0: CityUtils.toIntCityCode(company.getAddress().toString()));//注册地行政区划代码
       resultMap.put("BusinessScope",company.getBusinessScope()==null?"":company.getBusinessScope());//经营范围
       resultMap.put("ContactAddress",company.getContactAddress()==null?"":company.getContactAddress());//通信地址
       resultMap.put("EconomicType",company.getEconomicType()==null?"":company.getEconomicType());//经营业户经济类型
       resultMap.put("RegCapital",company.getRegCapital()==null?"":company.getRegCapital());//注册资本
       resultMap.put("LegalName",company.getLegalName()==null?"":company.getLegalName());//法人代表姓名
       resultMap.put("LegalID",company.getLegalId()==null?"":company.getLegalId());//法人代表身份证号
       resultMap.put("LegalPhone",company.getLegalPhone()==null?"":company.getLegalPhone());//法人代表电话
       resultMap.put("LegalPhoto",company.getLegalPhoto()==null?"":company.getLegalPhoto());//法人代表身份证扫描件文件编号
       if(StringUtils.isNotEmpty(company.getLegalPhoto())){
           StringBuffer fileName = new StringBuffer(company.getLegalPhoto());
            if(!company.getLegalPhoto().endsWith(".jpg")){
                fileName.append(".jpg");
                resultMap.put("LegalPhoto",fileName.toString());
            }
        }

        //异步上传图片
       if(StringUtils.isNotEmpty(company.getLegalPhoto())){
          try {
            new Thread(new SendImgService(company.getLegalPhoto())).start();
         } catch (Exception e) {
             log.error("公司基本信息图片上传失败!");
         }
       }
       resultMap.put("State",company.getState()==null?0:company.getState());//状态
       if(null!=company.getState()&&company.getState().intValue()==101){
        resultMap.put("State",0);//0可用1禁用
       }
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag()) ;//操作标识
       resultMap.put("UpdateTime",company.getCreateTime()==null?0:convertLongDate(company.getCreateTime()));//更新时间
       return resultMap;
    }

    /**
     * 网约车平台公司运营规模信息 26 11.20
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByCompanyStat(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       OperationInfo operationInfo= JSONObject.parseObject(message.getBody().toString(),OperationInfo.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("VehicleNum",operationInfo.getVehicleNum()==null?0:operationInfo.getVehicleNum());//平台注册网约车辆数
       resultMap.put("DriverNum",operationInfo.getDriverNum()==null?0:operationInfo.getDriverNum());//平台注册驾驶员数
       resultMap.put("Flag" ,message.getFlag()==null?0:message.getFlag());//操作标识
       resultMap.put("UpdateTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//更新时间
       return resultMap;
    }

    /**
     * 网约车平台公司支付信息 28
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByCompanyPay(Message message){
        Map<String,Object> resultMap= new HashMap<>();
       PayAccount payAccount = JSONObject.parseObject(message.getBody().toString(),PayAccount.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("PayName",payAccount.getPayName()==null?"支付宝":payAccount.getPayName());//银行或者非银行支付机构名称
       resultMap.put("PayId",payAccount.getPayId()==null?"NO0001":payAccount.getPayId());//非银行支付机构支付业5务许可证编号
       resultMap.put("PayType" ,payAccount.getPayType()==null?"1":payAccount.getPayType()+"");//支付业务类型
       resultMap.put("PayScope",payAccount.getPayScope()==null?"":payAccount.getPayScope());//业务覆盖范围
       resultMap.put("PrepareBank",payAccount.getPrepareBank()==null?"":payAccount.getPrepareBank());//备付金存管银行
       resultMap.put("CountDate",payAccount.getCountTimestamp()==null?30:payAccount.getCountTimestamp());//结算周期
       resultMap.put("State",payAccount.getState()==null?0:payAccount.getState());//状态
       if(null!=payAccount.getState()&&payAccount.getState().intValue()==101){
        resultMap.put("State",0);//0可用1禁用
       }
       resultMap.put("Flag",message.getFlag()==null?2:message.getFlag());//操作标识
       resultMap.put("UpdateTime",payAccount.getUpdateTime()==null?0:DateTimeUtils.convertNumberSec(payAccount.getUpdateTime().toLocalDateTime()));//更新时间
       return resultMap;
    }

    /**
     * 网约车平台公司服务机构 29
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByCompanyService(Message message){
        Map<String,Object> resultMap= new HashMap<>();
       Company company= JSONObject.parseObject(message.getBody().toString(),Company.class);

       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",company.getCityId()==null?0:CityUtils.toIntCityCode(company.getCityId().toString()));//许可地行政区划代码
       resultMap.put("ServiceName",company.getServiceName()==null?"":company.getServiceName());//服务机构名称
       resultMap.put("ServiceNo" ,company.getServiceNo()==null?"":company.getServiceNo());//服务机构代码
       resultMap.put("DetailAddress",company.getDetailAddress()==null?"":company.getDetailAddress());//服务机构地址
       resultMap.put("ResponsibleName",company.getResponsibleName()==null?"":company.getResponsibleName());//服务机构负责人姓名
       resultMap.put("ResponsiblePhone",company.getResponsiblePhone()==null?"":company.getResponsiblePhone());//负责人联系电话
       resultMap.put("ManagerName",company.getManagerName()==null?"":company.getManagerName());//服务机构管理人姓名
       resultMap.put("ManagerPhone",company.getManagerPhone()==null?"":company.getManagerPhone());//管理人联系电话
       resultMap.put("ContactPhone",company.getContactPhone()==null?"":company.getContactPhone());//服务机构紧急联系电话
       resultMap.put("MailAddress",company.getMailAddress()==null?"":company.getMailAddress());//行政文书送达邮寄地址
       resultMap.put("CreateDate",company.getCreateDate()==null?"":DateTimeUtils.convertNumberDay(company.getCreateDate().toLocalDateTime()));//服务机构设立日期
       resultMap.put("State",company.getState()==null?0:company.getState());//状态
       if(null!=company.getState()&&company.getState().intValue()==101){
        resultMap.put("State",0);//0可用1禁用
       }
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",company.getCreateTime()==null?0:convertLongDate(company.getCreateTime()));//更新时间
       return resultMap;
    }

    /**
     * 网约车平台公司经营许可 31
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByCompanyPermit(Message message){
        Map<String,Object> resultMap= new HashMap<>();
       LicenseInfo license= JSONObject.parseObject(message.getBody().toString(),LicenseInfo.class);

       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",license.getAddress()==null?0:CityUtils.toIntCityCode(license.getAddress().toString()));//许可地行政区划代码
       resultMap.put("Certificate",license.getCertifcate()==null?"":license.getCertifcate());//网络预约出租汽车经营许可证号
       resultMap.put("OperationArea" ,license.getOperationArea()==null?"":license.getOperationArea());//经营区域
       resultMap.put("OwnerName",license.getOwnerName()==null?"":license.getOwnerName());//公司名称
       resultMap.put("Organization",license.getOrganization()==null?"":license.getOrganization());//发证机构名称
       resultMap.put("StartDate",license.getStartDate()==null?"":DateTimeUtils.convertNumberDay(license.getStartDate().toLocalDateTime()));//有效期起
       resultMap.put("StopDate",license.getStopDate()==null?"":DateTimeUtils.convertNumberDay(license.getStopDate().toLocalDateTime()));//有效期止
       resultMap.put("CertifyDate",license.getCertifyDate()==null?"":DateTimeUtils.convertNumberDay(license.getCertifyDate().toLocalDateTime()));//初次发证日期
       resultMap.put("State",license.getState()==null?"0":license.getState());//证照状态
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",license.getCreateTime()==null?0:convertLongDate(license.getCreateTime()));//更新时间
       return resultMap;
    }
    /**
     * 网约车平台公司运价信息
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByCompanyFare(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       TPriceCaculationRule t=  JSONObject.parseObject(message.getBody().toString(),TPriceCaculationRule.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",t.getCityId()==null?0:CityUtils.toIntCityCode(t.getCityId().toString()));//许可地行政区划代码
       resultMap.put("FareType",t.getType()==null?"":"kgzc_"+t.getType().toString());//运价类型编码
       resultMap.put("FareTypeNote" ,t.getRuleName()==null?"":t.getRuleName().toString());//经营运价类型说明
       resultMap.put("FareValidOn",t.getFarevalidon()==null?0:t.getFarevalidon());//运价有效期起
       resultMap.put("FareValidOff",t.getFarevalidoff()==null?0:t.getFarevalidoff());//运价有效期止
       resultMap.put("StartFare",t.getStartFee()==null?0:t.getStartFee());//起步价
       resultMap.put("StartMile",t.getStarMile()==null?0:t.getStarMile() );//起步里程
       resultMap.put("UnitPricePerMile",t.getUnitpricepermile()==null?0:t.getUnitpricepermile());//计程单价
       resultMap.put("UnitPricePerMinute",t.getUnitpriceperminute()==null?0:t.getUnitpriceperminute());//计时单价
       resultMap.put("UpPrice",t.getFarAwayPrice()==null?0:t.getFarAwayPrice());//单程加价单价
       resultMap.put("UpPriceStartMile",UpPriceStartMile);//单程加价公里
       resultMap.put("MorningPeakTimeOn",t.getMorningpeaktimeon()==null?"":t.getMorningpeaktimeon().toString());//营运早高峰时间起
       resultMap.put("MorningPeakTimeOff",t.getMorningpeaktimeoff()==null?"":t.getMorningpeaktimeoff().toString());//营运早高峰时间止
       resultMap.put("EveningPeakTimeOn",t.getEveningpeaktimeon()==null?"":t.getEveningpeaktimeon().toString());//营运晚高峰时间起
       resultMap.put("EveningPeakTimeOff",t.getEveningpeaktimeoff()==null?"":t.getEveningpeaktimeoff().toString());//营运晚高峰时间止
       resultMap.put("OtherPeakTimeOn",t.getOtherPeakTimeOn()==null?"":t.getOtherPeakTimeOn());//其它营运高峰时间起
       resultMap.put("OtherPeakTimeOff",t.getOtherPeakTimeOff()==null?"":t.getOtherPeakTimeOff());//其它营运高峰时间止
       resultMap.put("PeakUnitPrice",t.getPackagePrice()==null?0:t.getPeakunitprice());//高峰时间单程加价单价
       resultMap.put("PeakPriceStartMile",t.getPeakpricestartmile()==null?0:t.getPeakpricestartmile());//高峰时间单程加价公里
       resultMap.put("LowSpeedPricePerMinute",t.getLowSpeedPricePerMinute() == null?0:t.getLowSpeedPricePerMinute());//低速计时加价公里
       resultMap.put("NightPricePerMile",t.getNightPrice()==null?0:t.getNightPrice());//夜间费（按公里）
       resultMap.put("NightPricePerMinute",t.getNightPricePerMinute() == null ? 0:t.getNightPricePerMinute());//夜间费（按分钟）
       resultMap.put("OtherPrice",t.getOtherPrice()==null? 0:t.getOtherPrice());//其它加价金额
       resultMap.put("State",t.getStatus()==null?0:t.getStatus());//状态
       if(null!=t.getStatus()&&t.getStatus().intValue()==101){
        resultMap.put("State",0);//0可用1禁用
       }
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",t.getCreateTime()==null?0:convertLongDate(t.getCreateTime()));//更新时间
       return resultMap;
    }

    /**
     * 车辆基本信息接口 34
     * @param message
     * @return
     */
     public  Map<String,Object> setBeanByBaseInfoVehicle(Message message){
        Map<String,Object> resultMap= new HashMap<>();
       Vehicle vehicle=  JSONObject.parseObject(message.getBody().toString(),Vehicle.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",vehicle.getCityId()==null?0:CityUtils.toIntCityCode(vehicle.getCityId().toString()));//许可地行政区划代码
       resultMap.put("VehicleNo",vehicle.getAutoNo()==null?"":vehicle.getAutoNo());//车辆号牌
       resultMap.put("PlateColor",vehicle.getPlateColorValue()==null?"":vehicle.getPlateColorValue());//车牌颜色
       resultMap.put("Seats" ,vehicle.getSeats()==null?4:vehicle.getSeats());//核定载客位
       resultMap.put("Brand",vehicle.getAutoBrand()==null?"":vehicle.getAutoBrand());//车辆厂牌
       resultMap.put("Model",vehicle.getAutoModel()==null?"":vehicle.getAutoModel());//车辆型号
       resultMap.put("VehicleType",vehicle.getTypeValue()==null?"":vehicle.getTypeValue());//车辆类型
       resultMap.put("OwnerName",vehicle.getOwnerName()==null?"":vehicle.getOwnerName());//车辆所有人
       resultMap.put("VehicleColor",vehicle.getVehicleColorValue()==null?"":vehicle.getVehicleColorValue().toString());//车辆颜色
       resultMap.put("EngineId",vehicle.getEngineId()==null?"":vehicle.getEngineId());//发动机号
       resultMap.put("VIN",vehicle.getVin()==null?"":vehicle.getVin());//车辆VIN码
       resultMap.put("CertifyDateA",vehicle.getCertifyDateA()==null?0:convertIntegerDate(vehicle.getCertifyDateA()));//车辆注册日期
       resultMap.put("FuelType",vehicle.getFuelType()==null?"":vehicle.getFuelType());//车辆燃料类型
       resultMap.put("EngineDisplace",vehicle.getEngineDisplace()==null?"":vehicle.getEngineDisplace());//发动机
       resultMap.put("PhotoId",vehicle.getPhotoImg()==null?"":vehicle.getPhotoImg());//车辆照片文件编号
       if(StringUtils.isNotEmpty(vehicle.getPhotoImg())){
           StringBuffer fileName = new StringBuffer(vehicle.getPhotoImg());
            if(!vehicle.getPhotoImg().endsWith(".jpg")){
                fileName.append(".jpg");
                resultMap.put("PhotoId",fileName.toString());
            }
        }

        //异步上传图片
       if(StringUtils.isNotEmpty(vehicle.getPhotoImg())){
          try {
            new Thread(new SendImgService(vehicle.getPhotoImg())).start();
         } catch (Exception e) {
             log.error("车辆图片上传失败!");
         }
       }
       resultMap.put("Certificate",vehicle.getCertificate()==null?"":vehicle.getCertificate());//运输证字号
       resultMap.put("TransAgency",vehicle.getTransAgency()==null?"":vehicle.getTransAgency());//车辆运输证发证机构
       resultMap.put("TransArea",vehicle.getTransArea()==null?"":vehicle.getTransArea());//车辆经营区域
       resultMap.put("TransDateStart",vehicle.getTransDateStart()==null?0:convertIntegerDate(vehicle.getTransDateStart()));//车辆运输证有效期起
       resultMap.put("TransDateStop",vehicle.getTransDateStop()==null?0:convertIntegerDate(vehicle.getTransDateStop()));//车辆运输证有效期止
       resultMap.put("CertifyDateB",vehicle.getCertifyDateB()==null?0:convertIntegerDate(vehicle.getCertifyDateB()));//车辆初次d登记日期
       resultMap.put("FixState",vehicle.getFixState()==null?"1":vehicle.getFixState().toString());//车辆检修状态
       resultMap.put("NextFixDate",vehicle.getNextFixDate()==null?0:convertIntegerDate(vehicle.getNextFixDate()));//车辆下次年检时间
       resultMap.put("CheckState",vehicle.getCheckState()==null?"":vehicle.getCheckState());//车辆年度审验状态
       resultMap.put("FeePrintId",vehicle.getFeePrintId()==null?"":vehicle.getFeePrintId());//发票打印设备序列号
       resultMap.put("GPSBrand",vehicle.getGpsBrand()==null?"":vehicle.getGpsBrand());//卫星定位装置品牌
       resultMap.put("GPSModel",vehicle.getGpsModel()==null?"":vehicle.getGpsModel());//卫星定位装置型号
       resultMap.put("GPSIMEI",vehicle.getGpsImei()==null?"":vehicle.getGpsImei());//卫星定位装置IMEI型号
       resultMap.put("GPSInstallDate",vehicle.getGpsInstallDate()==null?0:convertIntegerDate(vehicle.getGpsInstallDate()));//卫星定位设备安装日期
       resultMap.put("RegisterDate",vehicle.getRegisterDate()==null?0:convertIntegerDate(vehicle.getRegisterDate()));//报备日期
       resultMap.put("CommercialType",vehicle.getCommercialType()==null?1:vehicle.getCommercialType());//服务类型
       resultMap.put("FareType",vehicle.getFareType()==null?"":"kgzc_"+vehicle.getFareType().toString());//运价类型编码
       resultMap.put("State",vehicle.getState()==null?0:vehicle.getState());//状态
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",vehicle.getUpdateTime()==null?0:convertLongDate(vehicle.getUpdateTime()));//更新时间
       return resultMap;
    }
    /**
     * 车辆保险信息接口 37
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoVehicleInsurance(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Insurance insurance=  JSONObject.parseObject(message.getBody().toString(),Insurance.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("VehicleNo",insurance.getVehicleNo()==null?"":insurance.getVehicleNo());//车辆号牌
       resultMap.put("InsurCom",insurance.getInsurCom()==null?"":insurance.getInsurCom());//保险公司名称
       resultMap.put("InsurNum" ,insurance.getInsurNum()==null?"":insurance.getInsurNum());//保险号
       resultMap.put("InsurType" ,insurance.getInsurType()==null?"":insurance.getInsurType());//保险类型
       resultMap.put("InsurCount",insurance.getInsurCount()==null?0:insurance.getInsurCount());//保险金额
       resultMap.put("InsurEff",insurance.getInsurEff()==null?0:DateTimeUtils.convertNumberDay(insurance.getInsurEff().toLocalDateTime()));//保险生效时间
       resultMap.put("InsurExp",insurance.getInsurExp()==null?0:DateTimeUtils.convertNumberDay(insurance.getInsurExp().toLocalDateTime()));//保险到期时间
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//更新时间
       return resultMap;
    }
    /**
     * 网约车车辆里程信息接口 38
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoVehicleTotalMile(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       MileageRecord record= JSONObject.parseObject(message.getBody().toString(),MileageRecord.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",record.getAddress()==null?0:CityUtils.toIntCityCode(record.getAddress().toString()));//注册地行政区划代码
       resultMap.put("VehicleNo",record.getVehicleNo()==null?"":record.getVehicleNo());//车辆号牌
       resultMap.put("TotalMile" ,record.getTatalMile()==null?0:record.getTatalMile()/1000.00);//行驶总里程
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//更新时间
       return resultMap;
    }
    /**
     *驾驶员基本信息接口 40
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoDriver(Message message){
        Map<String,Object> resultMap= new HashMap<>();
       Driver driver=  JSONObject.parseObject(message.getBody().toString(),Driver.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",driver.getCityId() == null?0:CityUtils.toIntCityCode(driver.getCityId().toString()));//注册地行政区划代码
       resultMap.put("DriverName",driver.getName()==null?"":driver.getName());//机动车驾驶员姓名
       resultMap.put("DriverPhone" ,driver.getPhone()==null?"":driver.getPhone());//驾驶员手机号
       resultMap.put("DriverGender" ,driver.getGender()==null?"男":driver.getGender());//驾驶员性别
       if(null!=driver.getGender()){
          if (driver.getGender().equals("1")){
             resultMap.put("DriverGender","男");
          }else {
             resultMap.put("DriverGender","女");
          }
       }
       resultMap.put("DriverBirthday" ,driver.getBrithday()==null?0:convertIntegerDate(new Timestamp(driver.getBrithday().getTime())));//出生日期
       resultMap.put("DriverNationality" ,driver.getNationality()==null?"中国":driver.getNationality());//国籍
       resultMap.put("DriverNation" ,driver.getNationValue()==null?"汉族":driver.getNationValue());//驾驶员民族
       resultMap.put("DriverMaritalStatus" ,driver.getMaritalStatusValue()==null?"未婚":driver.getMaritalStatusValue());//驾驶员婚姻状况
       resultMap.put("DriverLanguageLevel" ,driver.getLanguageLevel()==null?"":driver.getLanguageLevel());//驾驶员外语能力
       resultMap.put("DriverEducation" ,driver.getEducationValue()==null?"":driver.getEducationValue());//驾驶员学历
       resultMap.put("DriverCensus" ,driver.getCensus()==null?"":driver.getCensus());//户口登记机构名称
       resultMap.put("DriverAddress" ,driver.getAddress()==null?"":driver.getAddress());//户口住址或长住地址
       resultMap.put("DriverContactAddress" ,driver.getContractAddress()==null?"":driver.getContractAddress());//驾驶员通信地址
       resultMap.put("PhotoId" ,driver.getHeadImg()==null?"":driver.getHeadImg());//驾驶员照片文件编号
       if(StringUtils.isNotEmpty(driver.getHeadImg())){
           StringBuffer fileName = new StringBuffer(driver.getHeadImg());
            if(!driver.getHeadImg().endsWith(".jpg")){
                fileName.append(".jpg");
                resultMap.put("PhotoId",fileName.toString());
            }
        }
        //异步上传图片
       if(StringUtils.isNotEmpty(driver.getHeadImg())){
          try {
            new Thread(new SendImgService(driver.getHeadImg())).start();
         } catch (Exception e) {
             log.error("驾驶员头像图片上传失败!");
         }
       }
       resultMap.put("LicenseId" ,driver.getLicenseId()==null?"":driver.getLicenseId().toString());//机动车驾驶证号
       resultMap.put("LicensePhotoId" ,driver.getLicensePhotoImg()==null?"":driver.getLicensePhotoImg().toString());//机动车驾驶证扫描件文件编号
       if(StringUtils.isNotEmpty(driver.getLicensePhotoImg())){
           StringBuffer fileName = new StringBuffer(driver.getLicensePhotoImg());
            if(!driver.getLicensePhotoImg().endsWith(".jpg")){
                fileName.append(".jpg");
                resultMap.put("LicensePhotoId",fileName.toString());
            }
        }
        //异步上传图片
       if(StringUtils.isNotEmpty(driver.getLicensePhotoImg())){
          try {
            new Thread(new SendImgService(driver.getLicensePhotoImg())).start();
         } catch (Exception e) {
             log.error("驾驶员驾驶证图片上传失败!");
         }
       }
       resultMap.put("DriverType" ,driver.getDriverType()==null?"":driver.getDriverType().toString());//准驾车型
       resultMap.put("GetDriverLicenseDate" ,driver.getGetDriverLicenseDate()==null?0:convertIntegerDate(driver.getGetDriverLicenseDate()));//初次领取驾驶证日期
       resultMap.put("DriverLicenseOn" ,driver.getDriverLicenseOn()==null?0:convertIntegerDate(driver.getDriverLicenseOn()));//驾驶证有效期限起
       resultMap.put("DriverLicenseOff" ,driver.getDriverLicenseOff()==null?0:convertIntegerDate(driver.getDriverLicenseOff()));//驾驶证有效期限止
       resultMap.put("TaxiDriver" ,driver.getTexiDriver()==null?0:driver.getTexiDriver());//是否巡游出租汽车驾驶员
       resultMap.put("CertificateNo" ,driver.getCertificateNo()==null?"":"");//网络预约出租车汽车驾驶员资格证号
       resultMap.put("NetworkCarIssueOrganization" ,driver.getNetworkCarIssueOrganization()==null?0:driver.getNetworkCarIssueOrganization().toString());//网络预约出租汽车驾驶员发证机构
       resultMap.put("NetworkCarIssueDate" ,driver.getNetworkCarIssueDate()==null?0:DateTimeUtils.convertNumberDay(driver.getNetworkCarIssueDate().toLocalDateTime()));//资格证发证日期
       resultMap.put("GetNetworkCarProofDate" ,driver.getGetNetworkCarProofDate()==null?0:DateTimeUtils.convertNumberDay(driver.getGetNetworkCarProofDate().toLocalDateTime()));//初次领取资格证日期
       resultMap.put("NetworkCarProofOn" ,driver.getNetworkCarProofOn()==null?0:DateTimeUtils.convertNumberDay(driver.getNetworkCarProofOn().toLocalDateTime()));//资格证有效起始日期
       resultMap.put("NetworkCarProofOff" ,driver.getNetworkCarProofOff()==null?0:DateTimeUtils.convertNumberDay(driver.getNetworkCarProofOff().toLocalDateTime()));//资格证有效截止日期
       resultMap.put("RegisterDate" ,driver.getRegisterDate()==null?0:DateTimeUtils.convertNumberDay(driver.getRegisterDate().toLocalDateTime()));//报备日期
       resultMap.put("FullTimeDriver" ,driver.getFullTimeDriver()==null?1:driver.getFullTimeDriver());//是否专职驾驶员
       resultMap.put("InDriverBlacklist" ,driver.getInDriverBlackList()==null?0:driver.getInDriverBlackList());//是否在驾驶员黑名单内
       resultMap.put("CommercialType" ,driver.getCommercialType()==null?1:driver.getCommercialType());//服务类型
       resultMap.put("ContractCompany" ,driver.getContractCompany()==null?"":driver.getContractCompany());//驾驶员合同签署公司
       resultMap.put("ContractOn" ,driver.getContractOn()==null?0:DateTimeUtils.convertNumberDay(driver.getContractOn().toLocalDateTime()));//合同有效期起
       resultMap.put("ContractOff" ,driver.getContractOff()==null?0:DateTimeUtils.convertNumberDay(driver.getContractOff().toLocalDateTime()));//合同有效期止
       resultMap.put("EmergencyContact" ,driver.getEmergencyContact()==null?"":driver.getEmergencyContact().toString());//紧急情况联系人
       resultMap.put("EmergencyContactPhone" ,driver.getEmergencyContactPhone()==null?"":driver.getEmergencyContactPhone().toString());//紧急情况联系人电话
       resultMap.put("EmergencyContactAddress" ,driver.getEmergencyContactAddress()==null?"":driver.getEmergencyContactAddress());//紧急情况联系人通信地址
       resultMap.put("State",driver.getState()==null?1:driver.getState());//状态 1 有效 2 无效
       if(null!=driver.getState()&&driver.getState().intValue()==101){
        resultMap.put("State",1);//状态 1 有效 2 无效
       }
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//更新时间

       return resultMap;
    }
     /**
     * 网约车驾驶员培训信息 43
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoDriverEducate(Message message){
        Map<String,Object> resultMap= new HashMap<>();
       Training training=  JSONObject.parseObject(message.getBody().toString(),Training.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",training.getAddress()==null?"":CityUtils.toIntCityCode(training.getAddress()));//注册地行政区划代码
       resultMap.put("LicenseId",training.getLicenseId()==null?"":training.getLicenseId().toString());//机动车驾驶证号
       resultMap.put("CourseName" ,training.getCourseName()==null?"":training.getCourseName().toString());//驾驶员培训课程名称
       resultMap.put("CourseDate",training.getCourseDate()==null? 0:convertIntegerDate(training.getCourseDate()));//培训课程日期
       resultMap.put("StartTime",training.getStartTime()==null?0:convertIntegerDate(training.getStartTime())+"");//培训开始时间
       resultMap.put("StopTime",training.getStopTime()==null?0:convertIntegerDate(training.getStopTime())+"");//培训结束时间
       resultMap.put("Duration",training.getDuration()==null?0:training.getDuration());//培训时长
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",training.getUpdateTime()==null?0:convertLongDate(training.getUpdateTime()));//更新时间
       return resultMap;
    }

   /**
     * 驾驶员移动终端信息 45
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoDriverApp(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       DriverMobileTerminal driverMobileTerminal=  JSONObject.parseObject(message.getBody().toString(),DriverMobileTerminal.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",driverMobileTerminal.getAddress()==null?"":CityUtils.toIntCityCode(driverMobileTerminal.getAddress()));//注册地行政区划代码
       resultMap.put("LicenseId",driverMobileTerminal.getLicenseId()==null?"":driverMobileTerminal.getLicenseId().toString());//机动车驾驶证号
       resultMap.put("DriverPhone" ,driverMobileTerminal.getDriverPhone()==null?"":driverMobileTerminal.getDriverPhone().toString());//驾驶员手机号
       resultMap.put("NetType",driverMobileTerminal.getNetType()==4?"":driverMobileTerminal.getNetType());//手机运营商
       resultMap.put("AppVersion",driverMobileTerminal.getAppVersion()==null?"":driverMobileTerminal.getAppVersion().toString());//使用APP版本号
       resultMap.put("MapType",driverMobileTerminal.getMapType()==null?2:driverMobileTerminal.getMapType());//使用地图类型
       resultMap.put("State",driverMobileTerminal.getStatus()==null?0:driverMobileTerminal.getStatus());//状态
       if(null!=driverMobileTerminal.getStatus()&&driverMobileTerminal.getStatus().intValue()==101){
        resultMap.put("State",0);//0可用1禁用
       }
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",driverMobileTerminal.getUpdateTime()==null?0:DateTimeUtils.convertNumberSec(driverMobileTerminal.getUpdateTime().toLocalDateTime()));//更新时间
       return resultMap;
    }

    /**
     * 驾驶员统计信息接口 46
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoDriverStat(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       DriverCensus driverCensus=  JSONObject.parseObject(message.getBody().toString(),DriverCensus.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("Address",driverCensus.getAddress()==null?"":CityUtils.toIntCityCode(driverCensus.getAddress()));//注册地行政区划代码
       resultMap.put("LicenseId",driverCensus.getLicenseId()==null?"":driverCensus.getLicenseId().toString());//机动车驾驶证号
        // TODO
       resultMap.put("Cycle" ,driverCensus.getCycle()==null?"":DateTimeUtils.convertNumberMonth(driverCensus.getCycle().toLocalDateTime()));//统计周期
       resultMap.put("OrderCount",driverCensus.getOrderCount()==null?0:driverCensus.getOrderCount());//完成订单次数
       resultMap.put("TrafficViolationCount",driverCensus.getTrafficViolationCount()==null?0:driverCensus.getTrafficViolationCount());//交通违章次数
       resultMap.put("ComplainedCount",driverCensus.getComplainedCount()==null?0:driverCensus.getComplainedCount());//被投诉次数
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",driverCensus.getUpdateTime()==null ?0: convertLongDate(driverCensus.getUpdateTime()));//更新时间
     return resultMap;
     }

     /**
     * 乘客基本信息接口 47
     * @param message
     * @return
     */
    public  Map<String,Object> setBeanByBaseInfoPassenger(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Customer customer=  JSONObject.parseObject(message.getBody().toString(),Customer.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("RegisterDate",customer.getCreateTime()==null?0:DateTimeUtils.convertNumberDay(customer.getCreateTime().toLocalDateTime()));//注册日期
       resultMap.put("PassengerPhone",customer.getPhone()==null?"":customer.getPhone());//乘客手机号
       resultMap.put("PassengerName",customer.getName()==null?"":customer.getName());//乘客称谓
       resultMap.put("PassengerGender",customer.getGender()==null?"男":customer.getGender().toString());//乘客性别
       if(null!=customer.getGender()){
          if (customer.getGender().intValue()==1){
             resultMap.put("PassengerGender","男");
          }else {
             resultMap.put("PassengerGender","女");
          }
       }
       resultMap.put("State",customer.getStatus()==null?0:customer.getStatus());//状态
       if(null!=customer.getStatus()&&customer.getStatus().intValue()==101){
        resultMap.put("State",0);//0可用1禁用
       }
       resultMap.put("Flag",message.getFlag()==null?1:message.getFlag());//操作标识
       resultMap.put("UpdateTime",customer.getUpdateTime()==null?0:convertLongDate(customer.getUpdateTime()));//更新时间
       return resultMap;
    }


   /**
    * 网约车平台订单发起请求信息
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOrderCreat(Message message){
       Map<String,Object> resultMap= new HashMap<>();
      Order order=  JSONObject.parseObject(message.getBody().toString(),Order.class);
      resultMap.put("CompanyId",companyId);//公司标识
      Integer cityId = order.getPlanOrigCityId();
      resultMap.put("Address",cityId==null?0:CityUtils.toIntCityCode(cityId.toString()));//许可地行政区划代码
      resultMap.put("OrderId",order.getOrderNo()==null?"":order.getOrderNo());//订单编号
      resultMap.put("DepartTime" ,convertLongDate(order.getPlanDepartTime()));//预计用车时间
      resultMap.put("OrderTime",convertLongDate(order.getCreateTime()));//订单发起时间
      resultMap.put("PassengerNote",order.getRemark()==null?"乘客":order.getRemark().toString());//乘客备注
      resultMap.put("Departure",order.getPlanOrig()==null?"未知":order.getPlanOrig());//预计出发地点详细地址
      resultMap.put("DepLongitude",order.getPlanOrigLng()==null?0:new BigDecimal(StringUtil.subStr(order.getPlanOrigLng())));//预计出发地点经度
      //resultMap.put("DepLongitude",0);//预计出发地点经度
      resultMap.put("DepLatitude",order.getPlanOrigLat()==null?0:new BigDecimal(StringUtil.subStr(order.getPlanOrigLat())));//预计出发地点纬度
      //resultMap.put("DepLatitude",0);//预计出发地点纬度
      resultMap.put("Destination",order.getPlanDest()==null?"未知":order.getPlanDest());//预计目的地
      resultMap.put("DestLongitude",order.getPlanDestLng()==null?0:new BigDecimal(StringUtil.subStr(order.getPlanDestLng())));//预计目的地经度
      //resultMap.put("DestLongitude",0);//预计目的地经度
      resultMap.put("DestLatitude",order.getPlanDestLat()==null?0:new BigDecimal(StringUtil.subStr(order.getPlanDestLat())));//预计目的地维度
      //resultMap.put("DestLatitude",0);//预计目的地维度
      resultMap.put("Encrypt",encrypt);//坐标加密标识
      resultMap.put("FareType", order.getFareType()==null?"":"kgzc_"+String.valueOf(order.getFareType()));
      return resultMap;
   }

   /**
    * 网约车平台订单成功信息
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOrderMatch(Message message){

	      Map<String,Object> resultMap= new HashMap<>();
	      Order4Flat order =JSONObject.parseObject(message.getBody().toString(),Order4Flat.class);
	      resultMap.put("CompanyId",companyId);//公司标识
	      resultMap.put("Address",order.getOrder()==null?"":CityUtils.toIntCityCode(String.valueOf(order.getOrder().getPlanOrigCityId())));//许可地行政区划代码
	      resultMap.put("OrderId",order.getOrder().getOrderNo()==null?"":order.getOrder().getOrderNo());//订单编号
	      resultMap.put("Longitude",order.getOrder().getPlanOrigLng()==null?0:new BigDecimal(StringUtil.subStr(order.getOrder().getPlanOrigLng())));//车辆经度
	      //resultMap.put("Longitude",0);//车辆经度
	      resultMap.put("Latitude",order.getOrder().getPlanOrigLat()==null?0:new BigDecimal(StringUtil.subStr(order.getOrder().getPlanOrigLat())));//车辆纬度
	      //resultMap.put("Latitude",0);//车辆纬度
	      resultMap.put("Encrypt",encrypt);//坐标加密标识
	      resultMap.put("LicenseId",order.getDriverLicenseId()==null?"":order.getDriverLicenseId());//机动车驾驶证编号
	      resultMap.put("DriverPhone",order.getOrder().getDriverPhone()==null?"":order.getOrder().getDriverPhone());//驾驶员手机号
	      resultMap.put("VehicleNo",order.getOrder().getAutoNo()==null?"":order.getOrder().getAutoNo());//车辆号牌
	      resultMap.put("DistributeTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//更新时间

      return resultMap;
	   }

   /**
    * 网约车平台订单撤销请求信息
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOrderCancel(Message message){
      Map<String,Object> resultMap= new HashMap<>();
      Orders orders=  JSONObject.parseObject(message.getBody().toString(),Orders.class);
      resultMap.put("CompanyId",companyId);//公司标识
      //TODO 通过城市ID 获取许可地行政区域代码
      Integer cityId = orders.getPlanOrigCityId();
      resultMap.put("Address",cityId==null?0:CityUtils.toIntCityCode(cityId.toString()));//许可地行政区划代码
      resultMap.put("OrderId",orders.getOrderNo()==null?"":orders.getOrderNo());//订单编号
      resultMap.put("OrderTime",orders.getCreateTime()==null?"":DateTimeUtils.convertNumberSec(orders.getCreateTime().toLocalDateTime()));//订单时间
      resultMap.put("CancelTime",orders.getCancelTime()==null?"":DateTimeUtils.convertNumberSec(orders.getCancelTime().toLocalDateTime()));//订单撤销时间
      resultMap.put("Operator",orders.getCancelType()==null?"1":orders.getCancelType().toString());//撤销发起方
      resultMap.put("CancelTypeCode",orders.getCancelType()==null?"1":orders.getCancelType().toString());//撤销类型代码
      resultMap.put("CancelReason",orders.getCancelReason()==null?"":orders.getCancelReason());//撤销或违约原因
      return resultMap;
   }

   /**
    * 网约车平台车辆经营上线信息
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOperateLogin(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Driver driver=  JSONObject.parseObject(message.getBody().toString(),Driver.class);
       resultMap.put("CompanyId",companyId);//公司标识
       //TODO 传入的是车辆还是驾驶员信息
       resultMap.put("LicenseId",driver.getLicenseId()==null?"":driver.getLicenseId());//机动车驾驶证号
       resultMap.put("VehicleNo",driver.getAutoNo()==null?"":driver.getAutoNo());//车辆号牌
       resultMap.put("LoginTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//车辆经营上线时间
       resultMap.put("Longitude" ,driver.getLng()==null?0:new BigDecimal(StringUtil.subStr(driver.getLng())));//上线经度
       //resultMap.put("Longitude",0);//上线经度
       resultMap.put("Latitude" ,driver.getLat()==null?0:new BigDecimal(StringUtil.subStr(driver.getLat())));//上线纬度
       //resultMap.put("Latitude",0);//上线纬度
       resultMap.put("Encrypt",encrypt);//坐标加密标识
      return resultMap;
   }

   /**
    * 网约车平台车辆经营下线
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOperateLogout(Message message){
      Map<String,Object> resultMap= new HashMap<>();
      //TODO 传入的是车辆还是驾驶员信息
      Driver driver=  JSONObject.parseObject(message.getBody().toString(),Driver.class);
      resultMap.put("CompanyId",companyId);//公司标识
      resultMap.put("LicenseId",driver.getLicenseId()==null?"":driver.getLicenseId());//机动车驾驶证号
      resultMap.put("VehicleNo",driver.getAutoNo()==null?"":driver.getAutoNo());//车辆号牌
      resultMap.put("LogoutTime",message.getCreateTime()==null?0:convertLongDate(new Timestamp(Long.valueOf(message.getCreateTime()))));//车辆经营下线时间
      resultMap.put("Longitude" ,driver.getLng()==null?0:new BigDecimal(StringUtil.subStr(driver.getLng())));//下线经度
       //resultMap.put("Longitude" ,0);//下线经度
      resultMap.put("Latitude" ,driver.getLat()==null?0:new BigDecimal(StringUtil.subStr(driver.getLat())));//下线纬度
       //resultMap.put("Latitude" ,0);//下线纬度
      resultMap.put("Encrypt",encrypt);//坐标加密标识
      return resultMap;
   }

   /**
    * 网约车平台经营出发接口
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOperateDepart(Message message){
       Map<String,Object> resultMap= new HashMap<>();
      //TODO 传入的是车辆还是驾驶员信息
      Order4Flat orders4Flat=  JSONObject.parseObject(message.getBody().toString(),Order4Flat.class);
      Order orders =orders4Flat.getOrder()==null?new Order():orders4Flat.getOrder();
      resultMap.put("CompanyId",companyId);//公司标识
      resultMap.put("OrderId",orders.getOrderNo()==null?"":orders.getOrderNo());//订单号
      resultMap.put("LicenseId",orders4Flat.getDriverLicenseId()==null?"":orders4Flat.getDriverLicenseId());//机动车驾驶证号
      resultMap.put("FareType" ,orders.getFareType()==null?"":"kgzc_"+orders.getFareType().toString());//运价类型编号
      resultMap.put("VehicleNo",orders4Flat.getAutoNo()==null?"":orders4Flat.getAutoNo());//车辆号牌
      resultMap.put("DepLongitude",orders.getActualOrigLng()==null?"":new BigDecimal(StringUtil.subStr(orders.getActualOrigLng())));//车辆出发经度
       //resultMap.put("DepLongitude",0);//车辆出发经度
      resultMap.put("DepLatitude",orders.getActualOrigLat()==null?"":new BigDecimal(StringUtil.subStr(orders.getActualOrigLat())));//车辆出发维度
       //resultMap.put("DepLatitude",0);//车辆出发维度
      resultMap.put("Encrypt",encrypt);//坐标加密标识
      resultMap.put("DepTime",convertLongDate(orders.getDepTime()));//上车时间
      resultMap.put("WaitMile",orders.getWaitMile()==null?0:orders.getWaitMile()/1000.00);//空驶里程
      resultMap.put("WaitTime",orders.getWaitTime()==null?0:orders.getWaitTime());//等待时间
      return resultMap;
   }

   /**
    * 网约车平台经营到达接口
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByOperateArrive(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Orders orders=  JSONObject.parseObject(message.getBody().toString(),Orders.class);
       resultMap.put("CompanyId",companyId);//公司标识
      resultMap.put("OrderId",orders.getOrderNo()==null?"":orders.getOrderNo());//订单号
      resultMap.put("DestLongitude",orders.getActualDestLng()==null?"":new BigDecimal(StringUtil.subStr(orders.getActualDestLng())));//车辆到达经度
       //resultMap.put("DestLongitude",0);//车辆到达经度
      resultMap.put("DestLatitude" ,orders.getActualDestLat()==null?"":new BigDecimal(StringUtil.subStr(orders.getActualDestLat())));//车辆到达纬度
       //resultMap.put("DestLatitude" ,0);//车辆到达纬度
      resultMap.put("Encrypt",encrypt);//坐标加密标识
      resultMap.put("DestTime",orders.getDestTime()==null?0:convertLongDate(orders.getDestTime()));//下车时间
      resultMap.put("DriveMile",orders.getDriveMile()==null?0:orders.getDriveMile()/1000.00);//载客里程
      resultMap.put("DriveTime",orders.getDriveTime()==null?0:orders.getDriveTime());//载客时间
      return resultMap;
   }

   /**
    * 网约车平台经营支付接口
    * @param message
    * @return
    */
	public Map<String,Object> setBeanByOperatePay(Message message) {
		Map<String,Object> resultMap = new HashMap<>();
		PayRecordDomain payRecordDomain = JSONObject.parseObject(message.getBody().toString(), PayRecordDomain.class);
		resultMap.put("CompanyId", companyId);// 公司标识
		resultMap.put("OrderId", payRecordDomain.getOrderNo()==null?"0":payRecordDomain.getOrderNo());// 订单编号
		resultMap.put("OnArea", payRecordDomain.getOnArea()==null?0:CityUtils.toIntCityCode(payRecordDomain.getOnArea().toString()));// 上车位置行政区划编号
		resultMap.put("DriverName",payRecordDomain.getDriverName()==null?"": payRecordDomain.getDriverName());// 机动车驾驶员姓名
		resultMap.put("LicenseId",payRecordDomain.getLicenseId() == null ? "0" : payRecordDomain.getLicenseId().toString());// 机动车驾驶证号
		resultMap.put("FareType", String.valueOf(payRecordDomain.getFareType())==null?"0":"kgzc_"+String.valueOf(payRecordDomain.getFareType()));// 运价类型编号
		resultMap.put("VehicleNo", payRecordDomain.getVehicleNo() == null ? "0" :payRecordDomain.getVehicleNo());// 车辆号牌
		resultMap.put("BookDepTime",payRecordDomain.getBookDepTime() == null ? "0" :DateTimeUtils.convertNumberSec(payRecordDomain.getBookDepTime().toLocalDateTime()));// 预计上车时间
		resultMap.put("WaitTime",payRecordDomain.getWaitTime());// 等待时间
		resultMap.put("DepLongitude", payRecordDomain.getDepLongItude()== null?0:new BigDecimal(StringUtil.subStr(payRecordDomain.getDepLongItude())));// 车辆出发经度
		resultMap.put("DepLatitude", payRecordDomain.getDepLatituDe()== null?0:new BigDecimal(StringUtil.subStr(payRecordDomain.getDepLatituDe())));// 车辆出发纬度
		resultMap.put("DepArea", payRecordDomain.getDepArea());// 上车地点
		resultMap.put("DepTime",payRecordDomain.getDepTime() == null ? 0 :DateTimeUtils.convertNumberSec(payRecordDomain.getDepTime().toLocalDateTime()));// 上车时间
		resultMap.put("DestLongitude", payRecordDomain.getDestLongitude()== null?0:new BigDecimal(StringUtil.subStr(payRecordDomain.getDestLongitude())));// 车辆到达经度
        //resultMap.put("DestLongitude", 0);// 车辆到达经度
		resultMap.put("DestLatitude", payRecordDomain.getDestLatitude()== null?0:new BigDecimal(StringUtil.subStr(payRecordDomain.getDestLatitude())));// 车辆到达纬度
        //resultMap.put("DestLatitude",0);// 车辆到达纬度
		resultMap.put("DestArea", payRecordDomain.getDestArea());// 下车地点
		resultMap.put("DestTime",payRecordDomain.getDestTime() == null ? 0:DateTimeUtils.convertNumberSec(payRecordDomain.getDestTime().toLocalDateTime()));// 下车时间
		resultMap.put("BookModel", payRecordDomain.getBookModelName());// 预定车型
		resultMap.put("Model", payRecordDomain.getModeName());// 实际使用车型
		resultMap.put("DriveMile", payRecordDomain.getDriveMile() == null ?0 : payRecordDomain.getDriveMile()/1000.00);// 载客里程
		resultMap.put("DriveTime", payRecordDomain.getDriveTime() == null ? 0 : payRecordDomain.getDriveTime());// 载客时间
		resultMap.put("WaitMile", payRecordDomain.getWaitMile() == null ? 0 : payRecordDomain.getWaitMile()/1000.00);// 空驶里程
		resultMap.put("FactPrice",payRecordDomain.getFactPrice() == null ? 0 : payRecordDomain.getFactPrice()/100);// 实收金额
		resultMap.put("Price", payRecordDomain.getFactPrice() == null ? 0 : payRecordDomain.getFactPrice()/100);// 应收金额
		resultMap.put("CashPrice", payRecordDomain.getCashPrice() == null ? 0 : payRecordDomain.getCashPrice()/100);// 现金支付金额
		resultMap.put("LineName", payRecordDomain.getLineName() == null ? "" : payRecordDomain.getLineName());// 电子支付机构
		resultMap.put("LinePrice", payRecordDomain.getLinePrice() == null ? 0 : payRecordDomain.getLinePrice()/100);// 电子支付金额
		resultMap.put("PosName", payRecordDomain.getPosName() == null ? "" : payRecordDomain.getPosName());// POS机支付机构
		resultMap.put("PosPrice", payRecordDomain.getPosPrice() == null ? 0 : payRecordDomain.getPosPrice()/100);// POS机支付金额
		resultMap.put("BenfitPrice", payRecordDomain.getBenfitPrice() == null ? 0 :payRecordDomain.getBenfitPrice());// 优惠金额
		resultMap.put("BookTip",payRecordDomain.getBookTip() == null ? "" : payRecordDomain.getBookTip());//预约服务费
		resultMap.put("PassengerTip", payRecordDomain.getPassEndgerTip() == null ? 0 : payRecordDomain.getPassEndgerTip());// 附加费
		resultMap.put("PeakUpPrice", payRecordDomain.getPeakUpPricec() == null ? 0 :payRecordDomain.getPeakUpPricec());// 高峰时段加价金额
		resultMap.put("NightUpPrice",payRecordDomain.getNightUpPrice() == null ? 0 :payRecordDomain.getNightUpPrice());// 夜间时段里程加加金额
		resultMap.put("FarUpPrice", payRecordDomain.getFarUpPrice() == null ? 0 : payRecordDomain.getFarUpPrice());// 远途加价金额
		resultMap.put("OtherUpPrice", payRecordDomain.getOtherUpPrice() ==null ? 0 :payRecordDomain.getOtherUpPrice());// 其它加价金额
		resultMap.put("PayState",String.valueOf(payRecordDomain.getPayState()) == null ? "2":payRecordDomain.getPayState()+"");//结算状态
		resultMap.put("PayTime",payRecordDomain.getPayTime() == null ? 0 :DateTimeUtils.convertNumberSec(payRecordDomain.getPayTime().toLocalDateTime()));// 乘客结算时间
		resultMap.put("OrderMatchTime",payRecordDomain.getDestTime() == null ? 0 :DateTimeUtils.convertNumberSec(payRecordDomain.getDestTime().toLocalDateTime()));// 订单完成时间
		resultMap.put("InvoiceStatus",payRecordDomain.getInvoiceStatus()+"");// 发票状态
		return resultMap;
	}


   /**
    * 网约车平台驾驶员定位信息接口
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByPositionDriver(Message message){
      Map<String,Object> resultMap= new HashMap<>();

      MileageLngLat mileageLngLat=  JSONObject.parseObject(message.getBody().toString(),MileageLngLat.class);
      resultMap.put("CompanyId",companyId);//公司标识
      resultMap.put("LicenseId",mileageLngLat.getLicenseId()==null?"":mileageLngLat.getLicenseId());//机动车驾驶证号
      resultMap.put("DriverRegionCode",mileageLngLat.getVehicleRegionCode()==null?0:CityUtils.toIntCityCode(mileageLngLat.getVehicleRegionCode().toString()));//行政区划代码
      resultMap.put("VehicleNo" ,mileageLngLat.getVehicleNo()==null?"":mileageLngLat.getVehicleNo());//车辆号牌
      resultMap.put("PositionTime",mileageLngLat.getUpTime()==null?"": Long.valueOf(DateUtils.Date2TimeStamp(mileageLngLat.getUpTime().toString(),DateUtils.formatDateStr)));//定位时间 时间戳
      resultMap.put("Longitude",mileageLngLat.getLng()==null?"":new BigDecimal(StringUtil.subStr(mileageLngLat.getLng())));//经度
      //resultMap.put("Longitude",0);//经度
      resultMap.put("Latitude",mileageLngLat.getLat()==null?"":new BigDecimal(StringUtil.subStr(mileageLngLat.getLat())));//纬度
      //resultMap.put("Latitude",0);//纬度
      resultMap.put("Encrypt",encrypt);//坐标加密标识
      resultMap.put("Direction" ,mileageLngLat.getBearing()==null?0:Long.valueOf(mileageLngLat.getBearing()));//方向角
      resultMap.put("Elevation",elevation);//海拔高度
      resultMap.put("Speed",mileageLngLat.getSpeed()==null?0:Math.round(Double.valueOf(mileageLngLat.getSpeed())));//瞬时速度
      resultMap.put("OrderId",mileageLngLat.getOrderId()==null?"0":mileageLngLat.getOrderId()+"");//订单编号
       /*if(null!=mileageLngLat.getOrderId()){
         resultMap.put("BizStatus",bizStatus);//营运状态 1载客
         resultMap.put("OrderId",mileageLngLat.getOrderId()+"");//订单编号
      }else{
         resultMap.put("BizStatus","3");//营运状态 3空驶
         resultMap.put("OrderId","0");//订单编号
      }*/
      return resultMap;
   }


   /**
    * 网约车平台车辆定位信息接口
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByPositionVehicle(Message message){
       Map<String,Object> resultMap= new HashMap<>();

      MileageLngLat mileageLngLat=  JSONObject.parseObject(message.getBody().toString(),MileageLngLat.class);
      resultMap.put("CompanyId",companyId);//
      resultMap.put("VehicleNo",mileageLngLat.getVehicleNo()==null?"":mileageLngLat.getVehicleNo());//车辆号牌
      resultMap.put("VehicleRegionCode",mileageLngLat.getVehicleRegionCode()==null?0:CityUtils.toIntCityCode(mileageLngLat.getVehicleRegionCode().toString()));//行政区划代码
      resultMap.put("PositionTime" ,mileageLngLat.getUpTime()==null?0:Long.valueOf(DateUtils.Date2TimeStamp(mileageLngLat.getUpTime().toString(),DateUtils.formatDateStr)));//定位时间 时间戳
      resultMap.put("Longitude",mileageLngLat.getLng()==null?"": new BigDecimal(StringUtil.subStr(mileageLngLat.getLng())));//经度
      //resultMap.put("Longitude",0);//经度
      resultMap.put("Latitude",mileageLngLat.getLat()==null?"":new BigDecimal(StringUtil.subStr(mileageLngLat.getLat())));//纬度
      //resultMap.put("Latitude",0);//纬度
      resultMap.put("Speed",mileageLngLat.getSpeed()==null?0:Math.round(Double.valueOf(mileageLngLat.getSpeed())));//瞬时速度
      resultMap.put("Direction",mileageLngLat.getBearing()==null?0:Long.valueOf(mileageLngLat.getBearing()));//方向角
      resultMap.put("Elevation",elevation);//海拔高度
      resultMap.put("Mileage" ,mileageLngLat.getMileage()==null?0:mileageLngLat.getMileage());//行驶里程
      resultMap.put("Encrypt",encrypt);//坐标加密标识
      resultMap.put("WarnStatus",mileageLngLat.getWarnStatus()==null?"":mileageLngLat.getWarnStatus());//预警状态
      resultMap.put("VehStatus",mileageLngLat.getVehStatus()==null?"":mileageLngLat.getVehStatus());//车辆状态
      resultMap.put("OrderId",mileageLngLat.getOrderId()==null?"0":mileageLngLat.getOrderId()+"");//订单编号

      /* if(null!=mileageLngLat.getOrderId()){
         resultMap.put("BizStatus",bizStatus);//营运状态 1载客
         resultMap.put("OrderId",mileageLngLat.getOrderId()+"");//订单编号
      }else{
         resultMap.put("BizStatus","3");//营运状态 3空驶
         resultMap.put("OrderId","0");//订单编号
      }*/
      return resultMap;
   }

   /**
    * 网约车平台乘客评价信息接口 11.20
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByRatedPassenger(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Comment comment=  JSONObject.parseObject(message.getBody().toString(),Comment.class);
       resultMap.put("CompanyId",companyId);//公司标识
      resultMap.put("OrderId",comment.getOrderNo()==null?"0":comment.getOrderNo());//订单号
      resultMap.put("EvaluateTime",comment.getEvaluateTime()==null?0:comment.getEvaluateTime());//评价时间
      resultMap.put("ServiceScore" ,comment.getServiceScore()==null?5:Math.round(comment.getServiceScore()+0.5));//服务满意度
      resultMap.put("DriverScore",comment.getDriverScore()==null?5:Math.round(comment.getDriverScore()));//驾驶员满意度
      resultMap.put("VehicleScore",comment.getVehicleScore()==null?5:Math.round(comment.getVehicleScore()));//车辆满意度
      resultMap.put("Detail",comment.getCommentContent()==null?"好评":comment.getCommentContent());//评价内容
      return resultMap;
   }

   /**
    * 网约车平台乘客投诉信息接口定义
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByRatedPassengerComplaint(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Complain complain=  JSONObject.parseObject(message.getBody().toString(),Complain.class);
       resultMap.put("CompanyId",companyId);//公司标识
      resultMap.put("OrderId",complain.getOrderNo()==null?"":complain.getOrderNo()==null?"":complain.getOrderNo());//订单编号
      resultMap.put("ComplaintTime" ,complain.getComplaintTime()==null?"":complain.getComplaintTime());//投诉时间
      resultMap.put("Detail",complain.getDetail()==null?"":complain.getDetail());//投诉内容
      resultMap.put("Result",complain.getResult()==null?"":complain.getResult());//处理结果
      return resultMap;
   }


   /**
    * 驾驶员处罚信息 66
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByRatedDriverPunish(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       Punish punish=  JSONObject.parseObject(message.getBody().toString(),Punish.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("LicenseId",punish.getLicenseId()==null?"":punish.getLicenseId());//机动车驾驶证编号
       resultMap.put("PunishTime",punish.getPunishTime()==null?"":punish.getPunishTime());//处罚时间
       resultMap.put("PunishReason" ,punish.getPunishReason()==null?"":punish.getPunishReason());//处罚原因
       resultMap.put("PunishResult",punish.getPunishResult()==null?"":punish.getPunishResult());//处罚结果
      return resultMap;
   }

   /**
    * 驾驶员信誉信息 67 11.20
    * @param message
    * @return
    */
   public  Map<String,Object> setBeanByRatedDriver(Message message){
       Map<String,Object> resultMap= new HashMap<>();
       RatedDriver ratedDriver=  JSONObject.parseObject(message.getBody().toString(),RatedDriver.class);
       resultMap.put("CompanyId",companyId);//公司标识
       resultMap.put("LicenseId",ratedDriver.getLicenseId()==null?"":ratedDriver.getLicenseId());//机动车驾驶证编号
       resultMap.put("Level",ratedDriver.getLevel()==null?5:Math.round(ratedDriver.getLevel()));//服务质量信誉等级
       resultMap.put("TestDate" ,ratedDriver.getTestDate()==null?"":ratedDriver.getTestDate());//服务质量信誉考核日期
       resultMap.put("TestDepartment",ratedDriver.getTestDepartment()==null?"无":ratedDriver.getTestDepartment());//服务质量信誉考核机构
      return resultMap;
   }


   /**
    * timestamp转换为YYYYMMdd
    * @param timeStamp
    * @return
    */
   private Integer convertIntegerDate(Timestamp timeStamp) {
      Integer registerDate = null;
      if (timeStamp == null){
         registerDate = DateTimeUtils.convertNumberDay(LocalDateTime.now());
      }else {
         registerDate = DateTimeUtils.convertNumberDay(timeStamp.toLocalDateTime());
      }
      return registerDate;
   }

   /**
    * timeStamp转换YYYYMMddhhmmss
    * @param timeStamp
    * @return
    */
   private Long convertLongDate(Timestamp timeStamp) {
      Long registerDate = null;
      if (timeStamp == null){
         registerDate = DateTimeUtils.convertNumberSec(LocalDateTime.now());
      }else {
         registerDate = DateTimeUtils.convertNumberSec(timeStamp.toLocalDateTime());
      }

      return registerDate;
   }

   /**
    * time 转换YYYYMMDDhhmmss
    * @param time
    * @return
    */
   private Long convertLongDateStr(String time){
      String str = "";

      if (time==null ||"".equals(time)){
        str = DateTimeUtils.convertNumberSec(LocalDateTime.now()).toString();
      }else {
        str  = DateFormatUtils.format(Long.valueOf(time), "YYYYMMDDhhmmss");
      }

      return Long.valueOf(str);
   }

   /**
    * time转换YYYYMMDD
    * @param time
    * @return
    */
   private Long convertIntegerDateStr(String time){
      String str = "";

      if (time==null ||"".equals(time)){
         str = DateTimeUtils.convertNumberDay(LocalDateTime.now()).toString();
      }else {
         str  = DateFormatUtils.format(Long.valueOf(time), "YYYYMMDD");
      }

      return Long.valueOf(str);
   }


}
